package com.aaa.sbm;

import com.aaa.sbm.entity.EntityA;
import com.aaa.sbm.entity.EntityB;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @FileName: SpringbootMybatisApplication
 * @Description:
 * @Author: zhz
 * @CreateTime: 2024/4/3 12:11
 * @Version: 1.0.0
 */
@SpringBootApplication
//@SpringBootConfiguration
//@EnableAutoConfiguration
@MapperScan("com.aaa.sbm.dao")
@EnableAsync
//@ComponentScan({"com.aaa.sbm.controller","com.aaa.sbm.service","com.aaa.sbm.configuration"})
//@MapperScan("com.aaa.sbm.dao")
public class SpringbootMybatisApplication {
    public static void main(String[] args) {
        //执行运行方法
         ApplicationContext applicationContext = SpringApplication.run(SpringbootMybatisApplication.class, args);
        EntityA entityA =  (EntityA)applicationContext.getBean("entityA");
        EntityB entityB = entityA.getEntityB();
        entityB.printInfo();
    }
}
